% utility to plot
% coherency images
% takes in SPMatrix [nfrq nlen nchn nch]

function[er] = cohplot(SPMatrix,ProcDef),

%C1 = ocoh(SPMatrix,2,4);
%C2 = ocoh(SPMatrix,1,5);
C3 = pcoh(SPMatrix,'Ex');
C4 = pcoh(SPMatrix,'Ey');


% subplot(4,1,1);
% imagesc(C1);
% colorbar;
% xlabel('Ex-Hy');
% subplot(4,1,2);
% imagesc(C2);
% colorbar;
% xlabel('Ey-Hx');
subplot(2,1,1);
imagesc(1:ProcDef.len,log10(1./ProcDef.TLFreq1),C3);
ylabel('Log10(Period) S');
colorbar;
xlabel('Ex to Hx Hy predicted coherency');
subplot(2,1,2);
imagesc(1:ProcDef.len,log10(1./ProcDef.TLFreq1),C4);
colorbar;
ylabel('Log10(Period) S');
xlabel('Ey to Hx Hy predicted coherency');
er=1;